home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0167.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  688 b   |  27 lines

  1. Hi there!
  2.  
  3.  > For FOO=1 To 128
  4.  >   For FOO2=1 to 128
  5.  >     If NAME$(FOO)<NAME$(FOO2) And FOO<>FOO2
  6.  >       Swap NAME$(FOO),NAME$(FOO2)
  7.  >       Swap BANKNUM(FOO),BANKNUM(FOO2)
  8.  >     EndIf
  9.  >   Next
  10.  > Next
  11.  
  12. Don't use something like this: it repeats 128^2 times the same operations,
  13. even if the data are already sorted.
  14. You can better think about a loop with a flag: if the datas are sorted,
  15. exit from the loop.
  16.  
  17. Bye
  18.  
  19.  
  20.  
  21.     berionne@flashnet.it                       >>Flagger<<
  22.   +---------------------------------------------------------------+
  23.   |   BASIC programmers never die, they GOSUB and don't RETURN.   |
  24.   +---------------------------------------------------------------+
  25.  
  26.  
  27.